home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d13
/
ptv2n1.arc
/
WATCHER.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-03-26
|
1KB
|
59 lines
Program Watcher;
Uses Crt,Watch;
Var I : Integer;
Wind0,
Wind1,
Wind2 : TextWindowPtr;
MyList : List;
WatchRec : WatchObj;
PROCEDURE Draw_Screen;
Var MainBox: Square;
Begin
ClrScr;
MainBox.init(1,3,80,22);
MainBox.Show;
Gotoxy(4,2);
Write('Watcher: Object-Oriented Variable Watch Program.');
Gotoxy(4,21);
Write('Enter variable name as shown above.' +
' (Case ignored). [Return] to quit.');
end; {draw screen}
PROCEDURE Init_Vars;
Begin
MyList.Init('Vars');
WatchRec.Init(2,23,@MyList);
New(Wind0,Init(5,6,25,19,'Wind0'));
I:=MyList.Add_Element(Wind0);
New(Wind1,Init(30,6,55,19,'Wind1'));
I:=MyList.Add_Element(Wind1);
New(Wind2,Init(60,6,77,19,'Wind2'));
I:=MyList.Add_Element(Wind2);
Wind0^.Show;
Wind1^.Show;
Wind2^.Show;
end; {init vars}
PROCEDURE Watch_Vars;
Var S : String;
AnObject : PointPtr;
FNum,Elem : Integer;
Begin
Repeat
Gotoxy(2,24); ClrEol; Write('Name: ');
Readln(S);
AnObject:=WatchRec.Find_Var(S,Fnum);
WatchRec.Show;
Until S='';
end; {Watch Vars}
Begin
Draw_Screen;
Init_Vars;
Watch_Vars;
ClrScr;
Writeln(' Watcher session complete.');
Writeln(' Copyright (c) 1990, Rick Gessner.');
end.